package java0331;

public class ExampleTest {

    public static void main(String[] args) {
        try {
            int ret = divide(4, 0);
            // try 代码块中,发生异常之后的代码是不会执行的
            System.out.println(ret);
//            System.out.println(ret);
            System.out.println("执行1");
        } catch (ArithmeticException e) {
            System.out.println("捕获的异常信息为:" + e.getMessage());
            return;
        } finally {
            System.out.println("finally 代码块");
        }
        System.out.println("执行2");
    }

    private static int divide(int x, int y) {
        return x / y;
    }

}
